<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::addGroup('',function () {
    Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');

    Router::addGroup('/admin', function () {
        //admin登录
        Router::post('/login', 'App\Controller\Admin\AccountController@login');
        //需要登录授权
        Router::addGroup('', function () {
            //管理员信息
            Router::get('/info','App\Controller\Admin\AccountController@info');
            //管理员列表
            Router::get('/list', 'App\Controller\Admin\AccountController@list');
            //上传图片
            Router::post('/upload', 'App\Controller\CommonController@upload');
            //大数据处理
            Router::post('/bidataExcel', 'App\Controller\Admin\BigdataExcelController@addYearMonthAndToSql');
            //读取excel文件
            Router::get('/readExcel', 'App\Controller\Admin\BigdataExcelController@readExcel');
        },['middleware' => [\App\Middleware\Auth::class]]);
    });
});